<script setup lang="ts">
import { ref, onMounted } from 'vue';
import { useRouter } from 'vue-router';

const router = useRouter()
const messages = ref<any>({})

onMounted(() => {
  window.gamerfinger.getLanguage().then(data => {
    messages.value = data
  })
})

function goHome(){
  router.push({
    name:"home",
  })
}

</script>

<template>
  <!-- 关于页面 -->
  <main>
    <div class="glass-container">
      <h1 class="title">Gamer Finger</h1>
      <p class="description">
        2024年打了游戏的时候其中几款游戏（黑神话悟空、艾尔登法环和只狼影逝二度）的多结局和刷素材需要反复读取存档。萌生了写一个游戏助手的想法，于是就有了这个项目。
      </p>
      <div @click="goHome" class="back-button">
        <span>{{ messages.back || '返回' }}</span>
      </div>
    </div>
  </main>
</template>

<style scoped>
main {
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(30, 30, 40, 0.9));
  box-sizing: border-box;
}

.glass-container {
  width: 100%;
  max-width: 600px;
  padding: 32px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  background: linear-gradient(45deg, #fff, #a9c4c2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.description {
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  text-align: justify;
  margin: 0;
  padding: 0 16px;
}

.back-button {
  box-sizing: border-box;
  width: 160px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
  transform: scale(1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.back-button:hover {
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(169, 196, 194, 0.4);
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.back-button:active {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}

.back-button span {
  font-size: 1rem;
  font-weight: 500;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
</style>